package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.yaml.snakeyaml.events.Event;

import java.util.Map;

@Mapper
public interface UserMapper {
    @Select("select *from user where openid=#{openid}")
    User selectByOpenid(String openid);
    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into user(openid,name,create_time) values(#{openid},#{name},#{createTime}) ")
    void insert(User user);
    //查询用户表获取用户相关信息
    @Select("select *from user where id=#{currentId}")
    User selectById(Long currentId);
    // 统计新增用户

    Integer countByMap(Map map);
}
